#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#===============================================================================
# Copyright 2011 zod.yslin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 
# Author: zod.yslin
# Email: 
# File Name: library.py
# Description: 
#   1. PEP 3108 -- Standard Library Reorganization
#   2. Some other changes to standard library modules, not covered by PEP 3108
# Edit History: 
#   2011-10-26    File created.
#===============================================================================

#===============================================================================
#   1. PEP 3108 -- Standard Library Reorganization
#      -Previously deprecated 
#           *PEP 4 -- Deprecation of Standard Modules
#      -Platform-specific with minimal use
#           *IRIX
#           *Mac-specific modules
#           *Solaris
#      -Hardly used
#      -Obsolete
#===============================================================================

#===============================================================================
#   2. Some other changes to standard library modules, not covered by PEP 3108
#===============================================================================

# Killed "sets" module. Use the builtin set() function.
#import sets  # only support 2.x 
#help(sets)

# Cleanup of the "sys" module: removed sys.exitfunc(), sys.exc_clear(), sys.exc_type, sys.exc_value, sys.exc_traceback. (Note that sys.last_type etc. remain.)
import sys
#help(sys)
# use the atexit module instead of exitfunc

# Cleanup of the array.array type: the read() and write() methods are gone;
# use fromfile() and tofile() instead. Also, the 'c' typecode for array is gone – 
# use either 'b' for bytes or 'u' for Unicode characters.
import array
#help(array)


# Cleanup of the "operator" module: removed sequenceIncludes() and isCallable().
import operator
#help(operator)

# Cleanup of the thread module: acquire_lock() and release_lock() are gone; use acquire() and release() instead.
# People should use 'threading' instead of 'thread'
#import thread  # support only 2.x
#help(thread)
import _thread
#help(_thread)
import threading # support 2.x and 3.x
#help(threading)

# Cleanup of the "random" module: removed the jumpahead() API.
import random
#help(random)

# The "new" module is gone.

# The functions os.tmpnam(), os.tempnam() and os.tmpfile() have been removed in favor of the "tempfile" module.

# The "tokenize" module has been changed to work with bytes. The main entry point is now tokenize.tokenize(), instead of generate_tokens.
import tokenize

# string.letters and its friends (string.lowercase and string.uppercase) are gone.
# Use string.ascii_letters etc. instead. 
# (The reason for the removal is that string.letters and friends had locale-specific behavior, which is a bad idea for such attractively-named global “constants”.)
import string

# Renamed module __builtin__ to builtins (removing the underscores, adding an ‘s’).
# The __builtins__ variable found in most global namespaces is unchanged. To modify a builtin, you should use builtins, not __builtins__!
import builtins

